using System;
using System.Collections.Generic;
using System.Text;
namespace MyDMS.BusinessLayer
{
	public class UserRole: BusinessObjectBase
	{

		#region InnerClass
		public enum UserRoleFields
		{
			Role_Code,
			Role_Name,
			Role_Description,
			Office_Code,
			Is_Active,
			Creation_Date,
			Updation_Date
		}
		#endregion

		#region Data Members

			int _role_Code;
			string _role_Name;
			string _role_Description;
			int _office_Code;
			bool? _is_Active;
			DateTime? _creation_Date;
			DateTime? _updation_Date;

		#endregion

		#region Properties

		public int  Role_Code
		{
			 get { return _role_Code; }
			 set
			 {
				 if (_role_Code != value)
				 {
					_role_Code = value;
					 PropertyHasChanged("Role_Code");
				 }
			 }
		}

		public string  Role_Name
		{
			 get { return _role_Name; }
			 set
			 {
				 if (_role_Name != value)
				 {
					_role_Name = value;
					 PropertyHasChanged("Role_Name");
				 }
			 }
		}

		public string  Role_Description
		{
			 get { return _role_Description; }
			 set
			 {
				 if (_role_Description != value)
				 {
					_role_Description = value;
					 PropertyHasChanged("Role_Description");
				 }
			 }
		}

		public int  Office_Code
		{
			 get { return _office_Code; }
			 set
			 {
				 if (_office_Code != value)
				 {
					_office_Code = value;
					 PropertyHasChanged("Office_Code");
				 }
			 }
		}

		public bool?  Is_Active
		{
			 get { return _is_Active; }
			 set
			 {
				 if (_is_Active != value)
				 {
					_is_Active = value;
					 PropertyHasChanged("Is_Active");
				 }
			 }
		}

		public DateTime?  Creation_Date
		{
			 get { return _creation_Date; }
			 set
			 {
				 if (_creation_Date != value)
				 {
					_creation_Date = value;
					 PropertyHasChanged("Creation_Date");
				 }
			 }
		}

		public DateTime?  Updation_Date
		{
			 get { return _updation_Date; }
			 set
			 {
				 if (_updation_Date != value)
				 {
					_updation_Date = value;
					 PropertyHasChanged("Updation_Date");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Role_Code", "Role_Code"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Role_Name", "Role_Name"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Role_Name", "Role_Name",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Role_Description", "Role_Description",200));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Office_Code", "Office_Code"));
		}

		#endregion

	}
}
